package top.tagao.yygh.hosp.controller;



import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import top.tagao.yygh.common.result.Result;
import top.tagao.yygh.hosp.service.DepartmentService;
import top.tagao.yygh.vo.hosp.DepartmentVo;

import java.util.List;

/**
 * @author fu-xiao-liu
 * @Date 2022/3/6 15:32
 */
@Api(tags = "科室调用接口")
//@CrossOrigin
@RestController
@RequestMapping("/admin/hospital/department")
public class DepartmentController {

    @Autowired
    private DepartmentService departmentService;


    @ApiOperation(value = "查询医院所有科室列表")
    @GetMapping("getDepartmentList/{hoscode}")
    public Result getDepartmentList(@PathVariable String hoscode) {
        List<DepartmentVo> list = departmentService.findDepartmentTree(hoscode);
        return Result.ok(list);
    }


}
